var SysUserTabLoginLogDatagrid = new HgUi.Datagrid("SysUserTabLoginLog_datagrid");
SysUserTabLoginLogDatagrid.toolbar = $("#SysUserTabLoginLog_toolbar");
SysUserTabLoginLogDatagrid.options.tipCells 
	= ["accountId","loginType","operCode","operName","engName",
	   "content","operRes","operIp","reqUri","reqType","reqMethod",
	   "browserType","reqUserAgent","loginLocation","crtTime"];
SysUserTabLoginLogDatagrid.init();
SysUserTabLoginLogDatagrid.grid.datagrid("enableFilter",[
	{
		field: 'operRes',
		type: 'combobox',
		options: {
			panelHeight:'auto',
			editable:false,
			prompt: '---请选择---',
			data:HgUtil.getDictComboboxData('LOG_RESULT'),
			onChange: function(value) {
				if (value == ''){
					SysUserTabLoginLogDatagrid.grid.datagrid('removeFilterRule', 'operRes');
				}
				else{
					SysUserTabLoginLogDatagrid.grid.datagrid('addFilterRule', {
						field: 'operRes',
						op: 'equal',
						value: value
					});
				}
				SysUserTabLoginLogDatagrid.grid.datagrid('doFilter');
			}
		}
	},
	{
		field: 'reqType',
		type: 'combobox',
		options: {
			panelHeight:'auto',
			editable:false,
			prompt: '---请选择---',
			data:HgUtil.getDictComboboxData('requestType'),
			onChange: function(value) {
				if (value == ''){
					SysUserTabLoginLogDatagrid.grid.datagrid('removeFilterRule', 'reqType');
				}
				else{
					SysUserTabLoginLogDatagrid.grid.datagrid('addFilterRule', {
						field: 'reqType',
						op: 'equal',
						value: value
					});
				}
				SysUserTabLoginLogDatagrid.grid.datagrid('doFilter');
			}
		}
	} 
]);


// 清空查询---------------------------------------------------------------------------------------------------
SysUserTabLoginLogDatagrid.toolbar.find("[tag=clear]").click(function() {
    SysUserTabLoginLogDatagrid.grid.datagrid("removeFilterRule");
    SysUserTabLoginLogDatagrid.grid.datagrid("load", {});
});
